home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / hypercrd / hc2_x / tcprogud.sit / TC Prog Guide / card_45309.txt < prev    next >
Text File  |  1991-02-27  |  936b  |  24 lines

  1. -- card: 45309 from stack: in
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 4755
  5. -- name: 
  6.  
  7.  
  8. -- part contents for background part 6
  9. ----- text -----
  10. 5.4  Bit Manipulation
  11.  
  12. -- part contents for background part 4
  13. ----- text -----
  14. In keeping with its heritage as a "low-level" (but extensible) language suited for writing operating systems, C provides numerous operators for bit manipulation.  Operands for these operators must be integral types.  For this purpose, integral values may be assigned using octal constants, which contain a leading zero:
  15.  
  16.     int    n = 077;     /* decimal value 63 */
  17.  
  18. Briefly, C's bit manipulation operators are:  bitwise negation (~); left shift (<<) and right shift (>>); bitwise AND (&), OR (|), and XOR (^); shorthand shift-assignment (<<= and >>=); shorthand AND-assignment (&=), OR-assignment (|=), and XOR-assignment        (^=). 
  19.  
  20.  
  21.  
  22. -- part contents for background part 7
  23. ----- text -----
  24. 152